# 添加异常检测代码
import json

from flask import Flask, request, jsonify
from test1 import *
app = Flask(__name__)


@app.route('/process', methods=['GET','POST'])
def process_data():


    if request.method == 'POST':
        data = request.get_json()

        user_id = data["user_id"]
        print("当前访问用户ID：", user_id)
        res = XHS_XPIDER(str(user_id))
        # try:
        result_data = res.xhs_main_app()
        return result_data



if __name__ == '__main__':

    app.run(host='0.0.0.0',port=5009,threaded=True)